package com.qfedu.dao;

import com.qfedu.entity.Exercises;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ExercisesDao {
    @Insert("insert into t_exercises values(#{id},#{category},#{equestion},#{eanswer},#{flag})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    int addExercuses(Exercises exercises);

    @Select("select * from t_exercises")
    List<Exercises> findExercisesAll();

    @Delete("delete from t_exercises where id = #{id}")
    int delExercises(int id);
}
